var user={};
var message=["username","email","qq","phone"];
var stdin=process.stdin;
var index=0;
var platform=process.platform;






switch(platform){
    case "win32" :
        console.log("请输入"+message[index]+":");
        stdin.on("data",function(chunk) {
    
            let str=chunk.toString("utf-8").replace("\r\n","");
            user[message[index]] = str;
            index++;
            if (index>3) {
                console.log("%j",user);
                process.exit();
            }
            console.log("请输入"+message[index]+":");
        })
        break;
    case "linux" :
        console.log("pls input"+message[index]+":");
        stdin.on("data",function(chunk) {
    
            let str=chunk.toString("utf-8").replace("\n","");
            user[message[index]] = str;
            index++;
            if (index>3) {
                console.log("%j",user);
                process.exit();
            }
            console.log("pls input"+message[index]+":");
        })
        break;
    default:
        console.log("undefinde platform");
}